//
//  VipNetwork.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/7/26.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "VipNetwork.h"
#import "GFXNetworkHandle.h"
#import "AdderMoneyModel.h"

NSString * const GetVipMoney = @"auth/member/joinMember/money";//选择会员获取钱数
NSString * const AdderToPay = @"auth/order/recharge/create";//选择会员去支付

@implementation VipNetwork


+ (void)getVipMoneyWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg,NSArray *moneyArr))response
{
    [[GFXNetworkHandle shareHandle]post:GetVipMoney params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            NSMutableArray *arr = [NSMutableArray array];
            for (NSDictionary *dict in json[@"result"]) {
                AdderMoneyModel *model = [AdderMoneyModel objectWithDict:dict];
                [arr addObject:model];
            }
            response(YES,json[@"message"],arr);
        }else{
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}

+ (void)adderGotoPayWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg,SingleCreateModel *sendModel))response
{
    [[GFXNetworkHandle shareHandle]post:AdderToPay params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            SingleCreateModel *sendModel = [SingleCreateModel objectWithDict:json[@"result"]];
            response(YES,json[@"message"],sendModel);
        }else{
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}

@end
